package com.mrogrape.notepad.activity.action;

import com.mrogrape.notepad.activity.action.item.AutoIndentMenuItemAction;
import com.mrogrape.notepad.activity.action.item.ClearMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CloseCurlyBracesMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CloseMarkupTagsMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CodeFoldingMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CopyAsRtfMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CopyMenuItemAction;
import com.mrogrape.notepad.activity.action.item.CutMenuItemAction;
import com.mrogrape.notepad.activity.action.item.DeleteMenuItemAction;
import com.mrogrape.notepad.activity.action.item.EOLMarkersVisibleMenuItemAction;
import com.mrogrape.notepad.activity.action.item.EditorFontSetupMenuItemAction;
import com.mrogrape.notepad.activity.action.item.FindNextMenuItemAction;
import com.mrogrape.notepad.activity.action.item.FindPreviousMenuItemAction;
import com.mrogrape.notepad.activity.action.item.FixLineToMaxMenuItemAction;
import com.mrogrape.notepad.activity.action.item.FromUnicodeMenuItemAction;
import com.mrogrape.notepad.activity.action.item.GotoLineMenuItemAction;
import com.mrogrape.notepad.activity.action.item.HyperlinkMenuItemAction;
import com.mrogrape.notepad.activity.action.item.InsertDateMenuItemAction;
import com.mrogrape.notepad.activity.action.item.InvertCaseMenuItemAction;
import com.mrogrape.notepad.activity.action.item.LineNumberVisibleMenuItemAction;
import com.mrogrape.notepad.activity.action.item.LineWrapMenuItemAction;
import com.mrogrape.notepad.activity.action.item.LowerCaseMenuItemAction;
import com.mrogrape.notepad.activity.action.item.MarkOccurrencesMenuItemAction;
import com.mrogrape.notepad.activity.action.item.OpenFileLocationMenuItemAction;
import com.mrogrape.notepad.activity.action.item.PasteMenuItemAction;
import com.mrogrape.notepad.activity.action.item.SecondaryHighlightMenuItemAction;
import com.mrogrape.notepad.activity.action.item.SelectAllMenuItemAction;
import com.mrogrape.notepad.activity.action.item.StateBarVisibleMenuItemAction;
import com.mrogrape.notepad.activity.action.item.ToUnicodeMenuItemAction;
import com.mrogrape.notepad.activity.action.item.ToggleLibraryPaneVisibleMenuItemAction;
import com.mrogrape.notepad.activity.action.item.ToggleToolbarVisibleMenuItemAction;
import com.mrogrape.notepad.activity.action.item.TrimEndOfLineMenuItemAction;
import com.mrogrape.notepad.activity.action.item.UpdateLogsMenuItemAction;
import com.mrogrape.notepad.activity.action.item.UpperCaseMenuItemAction;
import com.mrogrape.notepad.activity.action.item.WhiteSpaceVisibleMenuItemAction;

public class MainFrameActionFactory {

	/**
	 * 获取“打开文件位置”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchOpenFileLocationMenuItemAction() {

		if (MainFrameActionFactory.openFileLocationMenuItemAction == null) {

			MainFrameActionFactory.openFileLocationMenuItemAction = new OpenFileLocationMenuItemAction();
		}

		return MainFrameActionFactory.openFileLocationMenuItemAction;
	}

	private static NotepadAction openFileLocationMenuItemAction = null;

	/**
	 * 获取“复制”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCopyMenuItemAction() {

		if (MainFrameActionFactory.copyMenuItemAction == null) {

			MainFrameActionFactory.copyMenuItemAction = new CopyMenuItemAction();
		}

		return MainFrameActionFactory.copyMenuItemAction;
	}

	private static NotepadAction copyMenuItemAction = null;

	/**
	 * 获取“粘贴”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchPasteMenuItemAction() {

		if (MainFrameActionFactory.pasteMenuItemAction == null) {

			MainFrameActionFactory.pasteMenuItemAction = new PasteMenuItemAction();
		}

		return MainFrameActionFactory.pasteMenuItemAction;
	}

	private static NotepadAction pasteMenuItemAction = null;

	/**
	 * 获取“剪切”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCutMenuItemAction() {

		if (MainFrameActionFactory.cutMenuItemAction == null) {

			MainFrameActionFactory.cutMenuItemAction = new CutMenuItemAction();
		}

		return MainFrameActionFactory.cutMenuItemAction;
	}

	private static NotepadAction cutMenuItemAction = null;

	/**
	 * 获取“以RTF格式复制”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCopyAsRtfMenuItemAction() {

		if (MainFrameActionFactory.copyAsRtfMenuItemAction == null) {

			MainFrameActionFactory.copyAsRtfMenuItemAction = new CopyAsRtfMenuItemAction();
		}

		return MainFrameActionFactory.copyAsRtfMenuItemAction;
	}

	private static NotepadAction copyAsRtfMenuItemAction = null;

	/**
	 * 获取“清空”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchClearMenuItemAction() {

		if (MainFrameActionFactory.clearMenuItemAction == null) {

			MainFrameActionFactory.clearMenuItemAction = new ClearMenuItemAction();
		}

		return MainFrameActionFactory.clearMenuItemAction;
	}

	private static NotepadAction clearMenuItemAction = null;

	/**
	 * 获取“删除”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchDeleteMenuItemAction() {

		if (MainFrameActionFactory.deleteMenuItemAction == null) {

			MainFrameActionFactory.deleteMenuItemAction = new DeleteMenuItemAction();
		}

		return MainFrameActionFactory.deleteMenuItemAction;
	}

	private static NotepadAction deleteMenuItemAction = null;

	/**
	 * 获取“全选”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchSelectAllMenuItemAction() {

		if (MainFrameActionFactory.selectAllMenuItemAction == null) {

			MainFrameActionFactory.selectAllMenuItemAction = new SelectAllMenuItemAction();
		}

		return MainFrameActionFactory.selectAllMenuItemAction;
	}

	private static NotepadAction selectAllMenuItemAction = null;

	/**
	 * 获取“查找下一个”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchFindNextMenuItemAction() {

		if (MainFrameActionFactory.findNextMenuItemAction == null) {

			MainFrameActionFactory.findNextMenuItemAction = new FindNextMenuItemAction();
		}

		return MainFrameActionFactory.findNextMenuItemAction;
	}

	private static NotepadAction findNextMenuItemAction = null;

	/**
	 * 获取“查找上一个”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchFindPreviousMenuItemAction() {

		if (MainFrameActionFactory.findPreviousMenuItemAction == null) {

			MainFrameActionFactory.findPreviousMenuItemAction = new FindPreviousMenuItemAction();
		}

		return MainFrameActionFactory.findPreviousMenuItemAction;
	}

	private static NotepadAction findPreviousMenuItemAction = null;

	/**
	 * 获取“插入日期和事件”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchInsertDateMenuItemAction() {

		if (MainFrameActionFactory.insertDateMenuItemAction == null) {

			MainFrameActionFactory.insertDateMenuItemAction = new InsertDateMenuItemAction();
		}

		return MainFrameActionFactory.insertDateMenuItemAction;
	}

	private static NotepadAction insertDateMenuItemAction = null;

	/**
	 * 获取“变换为大写形式”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchUpperCaseMenuItemAction() {

		if (MainFrameActionFactory.upperCaseMenuItemAction == null) {

			MainFrameActionFactory.upperCaseMenuItemAction = new UpperCaseMenuItemAction();
		}

		return MainFrameActionFactory.upperCaseMenuItemAction;
	}

	private static NotepadAction upperCaseMenuItemAction = null;

	/**
	 * 获取“变换为小写形式”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchLowerCaseMenuItemAction() {

		if (MainFrameActionFactory.lowerCaseMenuItemAction == null) {

			MainFrameActionFactory.lowerCaseMenuItemAction = new LowerCaseMenuItemAction();
		}

		return MainFrameActionFactory.lowerCaseMenuItemAction;
	}

	private static NotepadAction lowerCaseMenuItemAction = null;

	/**
	 * 获取“反转大小写”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchInvertCaseMenuItemAction() {

		if (MainFrameActionFactory.invertCaseMenuItemAction == null) {

			MainFrameActionFactory.invertCaseMenuItemAction = new InvertCaseMenuItemAction();
		}

		return MainFrameActionFactory.invertCaseMenuItemAction;
	}

	private static NotepadAction invertCaseMenuItemAction = null;

	/**
	 * 获取“变换为Unicode标记”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchToUnicodeMenuItemAction() {

		if (MainFrameActionFactory.toUnicodeMenuItemAction == null) {

			MainFrameActionFactory.toUnicodeMenuItemAction = new ToUnicodeMenuItemAction();
		}

		return MainFrameActionFactory.toUnicodeMenuItemAction;
	}

	private static NotepadAction toUnicodeMenuItemAction = null;

	/**
	 * 获取“从Unicode标记变换为文本”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchFromUnicodeMenuItemAction() {

		if (MainFrameActionFactory.fromUnicodeMenuItemAction == null) {

			MainFrameActionFactory.fromUnicodeMenuItemAction = new FromUnicodeMenuItemAction();
		}

		return MainFrameActionFactory.fromUnicodeMenuItemAction;
	}

	private static NotepadAction fromUnicodeMenuItemAction = null;

	/**
	 * 获取“字体设置”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchEditorFontSetupMenuItemAction() {

		if (MainFrameActionFactory.editorFontSetupMenuItemAction == null) {

			MainFrameActionFactory.editorFontSetupMenuItemAction = new EditorFontSetupMenuItemAction();
		}

		return MainFrameActionFactory.editorFontSetupMenuItemAction;
	}

	private static NotepadAction editorFontSetupMenuItemAction = null;

	private MainFrameActionFactory() {
	};

	/**
	 * 获取“显示工具栏”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchToggleToolbarVisibleMenuItemAction() {

		if (MainFrameActionFactory.toggleToolbarVisibleMenuItemAction == null) {

			MainFrameActionFactory.toggleToolbarVisibleMenuItemAction = new ToggleToolbarVisibleMenuItemAction();
		}

		return MainFrameActionFactory.toggleToolbarVisibleMenuItemAction;
	}

	private static NotepadAction toggleToolbarVisibleMenuItemAction = null;

	/**
	 * 获取“显示状态栏”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchStateBarVisibleMenuItemAction() {

		if (MainFrameActionFactory.stateBarVisibleMenuItemAction == null) {

			MainFrameActionFactory.stateBarVisibleMenuItemAction = new StateBarVisibleMenuItemAction();
		}

		return MainFrameActionFactory.stateBarVisibleMenuItemAction;
	}

	private static NotepadAction stateBarVisibleMenuItemAction = null;

	/**
	 * 获取“显示行号”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchLineNumberVisibleMenuItemAction() {

		if (MainFrameActionFactory.lineNumberVisibleMenuItemAction == null) {

			MainFrameActionFactory.lineNumberVisibleMenuItemAction = new LineNumberVisibleMenuItemAction();
		}

		return MainFrameActionFactory.lineNumberVisibleMenuItemAction;
	}

	private static NotepadAction lineNumberVisibleMenuItemAction = null;

	/**
	 * 获取“自动换行”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchLineWrapMenuItemAction() {

		if (MainFrameActionFactory.lineWrapMenuItemAction == null) {

			MainFrameActionFactory.lineWrapMenuItemAction = new LineWrapMenuItemAction();
		}

		return MainFrameActionFactory.lineWrapMenuItemAction;
	}

	private static NotepadAction lineWrapMenuItemAction = null;

	/**
	 * 获取“显示空白字符”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchWhiteSpaceVisibleMenuItemAction() {

		if (MainFrameActionFactory.whiteSpaceVisibleMenuItemAction == null) {

			MainFrameActionFactory.whiteSpaceVisibleMenuItemAction = new WhiteSpaceVisibleMenuItemAction();
		}

		return MainFrameActionFactory.whiteSpaceVisibleMenuItemAction;
	}

	private static NotepadAction whiteSpaceVisibleMenuItemAction = null;

	/**
	 * 获取“显示EOL(End of line)字符”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchEOLMarkersVisibleMenuItemAction() {

		if (MainFrameActionFactory.EOLMarkersVisibleMenuItemAction == null) {

			MainFrameActionFactory.EOLMarkersVisibleMenuItemAction = new EOLMarkersVisibleMenuItemAction();
		}

		return MainFrameActionFactory.EOLMarkersVisibleMenuItemAction;
	}

	private static NotepadAction EOLMarkersVisibleMenuItemAction = null;

	/**
	 * 获取“显示EOL(End of line)字符”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchSecondaryHighlightMenuItemAction() {

		if (MainFrameActionFactory.secondaryHighlightMenuItemAction == null) {

			MainFrameActionFactory.secondaryHighlightMenuItemAction = new SecondaryHighlightMenuItemAction();
		}

		return MainFrameActionFactory.secondaryHighlightMenuItemAction;
	}

	private static NotepadAction secondaryHighlightMenuItemAction = null;

	/**
	 * 获取“标记出现位置”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchMarkOccurrencesMenuItemAction() {

		if (MainFrameActionFactory.markOccurrencesMenuItemAction == null) {

			MainFrameActionFactory.markOccurrencesMenuItemAction = new MarkOccurrencesMenuItemAction();
		}

		return MainFrameActionFactory.markOccurrencesMenuItemAction;
	}

	private static NotepadAction markOccurrencesMenuItemAction = null;

	/**
	 * 获取“代码折叠”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCodeFoldingMenuItemAction() {

		if (MainFrameActionFactory.codeFoldingMenuItemAction == null) {

			MainFrameActionFactory.codeFoldingMenuItemAction = new CodeFoldingMenuItemAction();
		}

		return MainFrameActionFactory.codeFoldingMenuItemAction;
	}

	private static NotepadAction codeFoldingMenuItemAction = null;

	/**
	 * 获取“标记内容中的超级链接”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchHyperlinkMenuItemAction() {

		if (MainFrameActionFactory.hyperlinkMenuItemAction == null) {

			MainFrameActionFactory.hyperlinkMenuItemAction = new HyperlinkMenuItemAction();
		}

		return MainFrameActionFactory.hyperlinkMenuItemAction;
	}

	private static NotepadAction hyperlinkMenuItemAction = null;

	/**
	 * 获取“自动缩进”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchAutoIndentMenuItemAction() {

		if (MainFrameActionFactory.autoIndentMenuItemAction == null) {

			MainFrameActionFactory.autoIndentMenuItemAction = new AutoIndentMenuItemAction();
		}

		return MainFrameActionFactory.autoIndentMenuItemAction;
	}

	private static NotepadAction autoIndentMenuItemAction = null;

	/**
	 * 获取“自动关闭大括号”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCloseCurlyBracesMenuItemAction() {

		if (MainFrameActionFactory.closeCurlyBracesMenuItemAction == null) {

			MainFrameActionFactory.closeCurlyBracesMenuItemAction = new CloseCurlyBracesMenuItemAction();
		}

		return MainFrameActionFactory.closeCurlyBracesMenuItemAction;
	}

	private static NotepadAction closeCurlyBracesMenuItemAction = null;

	/**
	 * 获取“自动关闭匹配标签”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchCloseMarkupTagsMenuItemAction() {

		if (MainFrameActionFactory.closeMarkupTagsMenuItemAction == null) {

			MainFrameActionFactory.closeMarkupTagsMenuItemAction = new CloseMarkupTagsMenuItemAction();
		}

		return MainFrameActionFactory.closeMarkupTagsMenuItemAction;
	}

	private static NotepadAction closeMarkupTagsMenuItemAction = null;

	/**
	 * 获取“移除行尾空白字符”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchTrimEndOfLineMenuItemAction() {

		if (MainFrameActionFactory.trimEndOfLineMenuItemAction == null) {

			MainFrameActionFactory.trimEndOfLineMenuItemAction = new TrimEndOfLineMenuItemAction();
		}

		return MainFrameActionFactory.trimEndOfLineMenuItemAction;
	}

	private static NotepadAction trimEndOfLineMenuItemAction = null;

	/**
	 * 获取“固定行宽至最宽行”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchFixLineToMaxMenuItemAction() {

		if (MainFrameActionFactory.fixLineToMaxMenuItemAction == null) {

			MainFrameActionFactory.fixLineToMaxMenuItemAction = new FixLineToMaxMenuItemAction();
		}

		return MainFrameActionFactory.fixLineToMaxMenuItemAction;
	}

	private static NotepadAction fixLineToMaxMenuItemAction = null;

	/**
	 * 获取“跳转到行”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchGotoLineMenuItemAction() {

		if (MainFrameActionFactory.gotoLineMenuItemAction == null) {

			MainFrameActionFactory.gotoLineMenuItemAction = new GotoLineMenuItemAction();
		}

		return MainFrameActionFactory.gotoLineMenuItemAction;
	}

	private static NotepadAction gotoLineMenuItemAction = null;

	/**
	 * 获取“显示库视图”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchToggleLibraryPaneVisibleMenuItemAction() {

		if (MainFrameActionFactory.toggleLibraryPaneVisibleMenuItemAction == null) {

			MainFrameActionFactory.toggleLibraryPaneVisibleMenuItemAction = new ToggleLibraryPaneVisibleMenuItemAction();
		}

		return MainFrameActionFactory.toggleLibraryPaneVisibleMenuItemAction;
	}

	private static NotepadAction toggleLibraryPaneVisibleMenuItemAction = null;

	/**
	 * 获取“更新日志”菜单项的Action
	 * 
	 * @return
	 */
	public static NotepadAction fetchUpdateLogsMenuItemAction() {

		if (MainFrameActionFactory.updateLogsMenuItemAction == null) {

			MainFrameActionFactory.updateLogsMenuItemAction = new UpdateLogsMenuItemAction();
		}

		return MainFrameActionFactory.updateLogsMenuItemAction;
	}

	private static NotepadAction updateLogsMenuItemAction = null;
}
